package com.huirui.server.constant;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

/**
 * 订单状态枚举
 */
@Getter
public enum OrderStatus {
    /**
     * 待付款
     */
    PENDING_PAYMENT(0, "待付款"),
    /**
     * 待发货
     */
    PENDING_DELIVERY(1, "待发货"),
    /**
     * 待收货
     */
    PENDING_RECEIPT(2, "待收货"),
    /**
     * 已完成
     */
    COMPLETED(3, "已完成"),
    /**
     * 已取消
     */
    CANCELED(4, "已取消"),
    /**
     * 售后
     */
    AFTER_SALES(5, "售后");

    // 用于存储数据库中的值
    @EnumValue
    @JsonValue
    private final Integer code;
    private final String description;

    OrderStatus(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

}